#ifndef KLISTVIEWDELEGATE_H
#define KLISTVIEWDELEGATE_H

#include <QStyledItemDelegate>
#include <QStyleOptionViewItem>
#include <QPixmap>
#include "themeController.h"
#include <QAbstractItemView>

namespace kdk {

/**
 * @defgroup ListViewModule
 */

class KListViewDelegatePrivate;

/**
 * @brief 配合KListview可以提供一个图片两行文字的显示效果，若只有一行文字，则对于 icon 居中显示 。
 */
class KListViewDelegate :public QStyledItemDelegate,public ThemeController
{
    Q_OBJECT
public:
    KListViewDelegate(QAbstractItemView*parent);
    ~KListViewDelegate();

protected:
     void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;//重写绘制事件
     virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
private:
     Q_DECLARE_PRIVATE(KListViewDelegate);
     KListViewDelegatePrivate* const d_ptr;
};
}
#endif // KLISTVIEWDELEGATE_H
